package com.cyj.mongodbsign.cyj.pojo;

import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(collection = "comment")
@CompoundIndex( def = "{'id': 1, 'nickname': -1}") //复合索引
public class Student implements Serializable {

    @Excel(name = "id", width =25)
    private Integer studentId;

    @Indexed
    @Excel(name = "studentName",width =25)
    private String studentName;
    @Excel(name = "status",width =25)
    private Integer status;
    @Excel(name = "sigTime", format = "yyyy-MM-dd HH:mm", width =25)
    private String sigTime;

    public static String getCollectionName(){
        return "students";
    }
}
